package com.itheima.java.ai.langchin4j.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.java.ai.langchin4j.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    
    @Select("SELECT * FROM users WHERE username = #{username} OR email = #{username}")
    User findByUsernameOrEmail(String username);
    
    @Select("SELECT * FROM users WHERE email = #{email}")
    User findByEmail(String email);
    
    @Select("SELECT * FROM users WHERE phone = #{phone}")
    User findByPhone(String phone);
    
    @Select("SELECT * FROM users WHERE id_card = #{idCard}")
    User findByIdCard(String idCard);
}